/*****************************************************************************
 * iTMS.cs: iTMS 4.7 support
 *****************************************************************************/

using System;

public class ITMS
{
    static byte [] scramble_vector = new byte[ 4096 ]
    {
        0x04,0x91,0x69,0x33,0x41,0xF5,0x79,0xE9,0x57,0x55,0x18,0x6E,
        0x76,0x95,0x75,0x02,0x53,0x5B,0xF6,0x39,0x35,0xFB,0x7E,0x45,
        0x81,0x90,0xC7,0xA4,0xC6,0xB5,0x84,0x23,0xCE,0xD6,0x15,0x98,
        0x92,0x67,0x5D,0xE3,0x17,0x44,0x2C,0xF8,0xA9,0xD9,0x32,0x5C,
        0x83,0xE0,0x0E,0xCC,0x8C,0x72,0x7C,0x8F,0x78,0xAB,0x38,0x9E,
        0xE8,0xB7,0x30,0xB0,0x25,0xC0,0x29,0x1C,0x24,0x9B,0xE7,0xC9,
        0xDD,0x34,0xBD,0x7D,0x7A,0xBF,0xF2,0xB2,0xF9,0x6F,0x6D,0xAA,
        0x06,0xB4,0xED,0xAE,0xFE,0xCA,0x11,0xDF,0xE6,0xC3,0x8D,0x2F,
        0x43,0xB6,0x63,0x68,0x0F,0xEE,0x2D,0x07,0x1B,0x14,0xA6,0xCF,
        0x9F,0xC4,0xF4,0xA2,0x85,0x36,0x8A,0x74,0x08,0xA8,0x9C,0x10,
        0x00,0x26,0x94,0x42,0x13,0x56,0x73,0x49,0xEF,0xBC,0x88,0x3D,
        0x6C,0x21,0xF7,0x8E,0xC1,0x27,0x5A,0x52,0x22,0xC8,0xC5,0x1A,
        0x58,0x0A,0x19,0x47,0x01,0x77,0x82,0x64,0x62,0x12,0x9A,0x48,
        0x6A,0x4E,0x46,0xD5,0xAD,0x0C,0xE5,0xEB,0xE4,0xBA,0x4D,0xD1,
        0x54,0x93,0xA0,0x7F,0x4C,0x40,0x8B,0x70,0x3C,0xDE,0xB1,0xFD,
        0x31,0x1E,0x51,0xA1,0x0D,0x7B,0xF3,0x3E,0xD4,0x1F,0x61,0x50,
        0xFA,0x09,0xE1,0x99,0x28,0x2E,0xAC,0xDA,0xDC,0xB8,0x3F,0x1D,
        0x66,0xC2,0x16,0x4F,0x3B,0xB3,0x60,0x37,0x0B,0x9D,0xAF,0x5F,
        0x71,0x6B,0xB9,0xD2,0xD0,0xA7,0xEC,0x59,0x20,0x80,0x89,0x2B,
        0xF1,0x4B,0x96,0x2A,0x87,0xEA,0xD7,0x05,0xBB,0xA3,0x97,0x03,
        0x5E,0xA5,0xCB,0x86,0xD3,0x65,0xD8,0xBE,0x3A,0xCD,0xDB,0xFC,
        0x4A,0xE2,0xFF,0xF0,0xC9,0xE2,0x5F,0x0A,0x62,0xDE,0x6A,0x92,
        0xFE,0x56,0x6D,0x89,0x23,0x27,0x38,0xF3,0xF5,0xF1,0x39,0xB5,
        0x9E,0xFA,0x68,0x59,0x17,0x9A,0x28,0x2A,0x84,0xB3,0xC3,0x30,
        0x4C,0x16,0xA7,0x22,0x19,0x44,0x3E,0x3A,0xEB,0xD1,0x7D,0xDD,
        0xCE,0xAE,0x93,0xF2,0xFB,0xC2,0xD0,0xDC,0xC8,0x3F,0xC1,0x0B,
        0x9C,0x09,0x00,0x04,0x2E,0xA4,0x29,0x90,0xD4,0x26,0x65,0x5A,
        0x55,0x75,0x1C,0xBA,0x9F,0x12,0xB7,0xAD,0x61,0xD5,0xCF,0x5E,
        0xBB,0x48,0x72,0x9D,0x07,0x06,0x7E,0x35,0xCB,0x79,0xBC,0xAB,
        0x4E,0x36,0xCA,0x64,0x82,0xAC,0xE8,0xE3,0xE0,0xE9,0x7A,0x13,
        0x6C,0xEC,0x96,0x45,0x4B,0x2B,0x67,0x8E,0x7B,0x46,0xEE,0x2D,
        0xA9,0xD3,0x2C,0x78,0x47,0x8C,0x7C,0x94,0xC5,0x85,0x71,0xA3,
        0x58,0xD8,0x4F,0xAF,0xC7,0xEA,0x50,0x63,0xE7,0x6E,0x51,0x5C,
        0xB6,0x25,0xAA,0x9B,0x1B,0x54,0xB4,0x21,0x1F,0x6F,0x0D,0x02,
        0x88,0x7F,0x69,0xC4,0x3B,0x66,0xB8,0xF9,0x49,0xA5,0xED,0xB9,
        0x0F,0xA0,0xEF,0x70,0xB2,0xA2,0x14,0x2F,0xDB,0xC0,0x08,0x42,
        0xD9,0xA1,0x01,0x37,0x5B,0xB1,0xF6,0x1A,0xC6,0xBF,0x11,0x53,
        0x8D,0x5D,0x20,0x15,0x1E,0x3D,0x34,0xFD,0x24,0x60,0x77,0x74,
        0x8B,0xFC,0x4A,0x33,0x97,0x91,0x4D,0xFF,0xE1,0xB0,0xF8,0x0C,
        0x03,0x98,0x86,0xF0,0xE6,0x3C,0x76,0x05,0xD2,0xBE,0x81,0xF4,
        0xCD,0x0E,0x95,0xA6,0xF7,0xCC,0x43,0xBD,0x32,0x99,0x83,0x87,
        0x8F,0xD6,0x80,0xDF,0xE5,0xE4,0x40,0xDA,0x8A,0x57,0x1D,0x31,
        0xA8,0x52,0xD7,0x41,0x73,0x6B,0x10,0x18,0xD0,0x6E,0x6D,0x8B,
        0x09,0x64,0x0A,0x84,0x60,0x85,0x05,0xDC,0xFA,0x5C,0x24,0x3D,
        0xF4,0x75,0xAB,0x44,0x34,0x08,0x90,0xA2,0x92,0x43,0x6B,0xC8,
        0xF0,0x93,0xD5,0x36,0xFD,0x48,0x55,0xEA,0x0B,0x1D,0x26,0xB2,
        0xB8,0x5B,0x2C,0xD7,0xCA,0x65,0xF7,0x2E,0xBE,0x01,0x58,0xE5,
        0xAD,0x72,0x10,0x63,0x68,0x1A,0xBA,0x94,0x59,0xB7,0x89,0x35,
        0xB9,0xCE,0xAF,0xA4,0xDA,0x14,0xE1,0x57,0xE7,0x39,0x79,0xA8,
        0x03,0x78,0xFE,0x53,0x1C,0x50,0xC9,0x3C,0x9E,0x4C,0x27,0x00,
        0xF3,0xA6,0xCC,0x31,0xBD,0x52,0xFF,0x5F,0x3E,0x61,0x45,0xE0,
        0x3F,0x9C,0x9A,0xC7,0xF6,0xD4,0xED,0x38,0x20,0x95,0xB0,0xA3,
        0xE4,0xFC,0xD3,0x18,0xD6,0xBC,0x0E,0xDE,0x54,0x8A,0xDD,0xCB,
        0x37,0x7A,0x23,0x3A,0x7F,0x16,0x47,0x22,0xAA,0xD2,0x62,0x07,
        0x1F,0xE2,0x2B,0x97,0xBF,0x3B,0x98,0x17,0x5A,0x42,0x2A,0xDF,
        0x0C,0xBB,0x21,0x82,0x76,0x71,0x29,0xF5,0x06,0x30,0xEE,0x51,
        0xF2,0x8D,0x4E,0xA1,0x15,0xB3,0x67,0xF9,0x41,0xD8,0x04,0x9B,
        0x4D,0x9F,0x19,0x12,0xFB,0xAE,0xEF,0x6F,0xA9,0x49,0xE6,0xD1,
        0xF1,0x81,0xA0,0xC4,0x02,0xC0,0x96,0x2F,0x2D,0x7D,0x4B,0x1E,
        0xB6,0x33,0x7C,0x0D,0x25,0xE3,0x7B,0x0F,0x6C,0x7E,0xE9,0xF8,
        0xCF,0x77,0x83,0x46,0x88,0x4A,0xB4,0x99,0xAC,0xB5,0xC1,0xDB,
        0xD9,0xC3,0xEC,0x11,0x8F,0x4F,0x66,0x13,0x80,0xEB,0xC6,0x1B,
        0x73,0xC2,0x70,0xB1,0x9D,0xA5,0x5E,0x8C,0x56,0x5D,0x8E,0x40,
        0x91,0x69,0xCD,0x87,0x6A,0xE8,0x74,0xA7,0x32,0xC5,0x86,0x28,
        0x75,0xA1,0xAA,0xC1,0x6D,0x6F,0x3A,0x50,0x37,0xA0,0x08,0x38,
        0x6A,0xEF,0x35,0xF7,0x80,0x41,0xE8,0xAD,0x4A,0x69,0xF4,0xBC,
        0xE9,0xBE,0x31,0x9F,0xD2,0x6E,0xD4,0x89,0x5C,0x3C,0x43,0x12,
        0x6B,0x64,0x73,0xD3,0xB9,0x1B,0x1F,0xE6,0x07,0x20,0x66,0x4D,
        0x2C,0xC7,0xD9,0x0D,0x96,0xFC,0x17,0x3E,0xC8,0xFF,0x00,0x1D,
        0x36,0x24,0x67,0x0C,0xA2,0x85,0xBF,0x39,0xF0,0xF2,0x02,0x5E,
        0xC2,0x1C,0x93,0x9D,0xC0,0xD5,0x06,0x2B,0xCC,0x9A,0x33,0x99,
        0xDE,0x79,0x0B,0xFE,0x97,0xB4,0x47,0xAC,0xE1,0x7B,0x7F,0x61,
        0x19,0xAB,0xF9,0x4F,0xE3,0x28,0x88,0xB1,0x04,0xE5,0x23,0xF3,
        0xC3,0x27,0x78,0xA8,0x8A,0x09,0x94,0xB8,0x05,0x71,0xDA,0x65,
        0x2D,0xBA,0x8C,0x55,0x8F,0xFD,0xB5,0x3F,0xE4,0x86,0x4B,0x70,
        0xDB,0x5F,0x6C,0x60,0x21,0xC9,0x25,0x03,0xA5,0xE2,0xB6,0xAF,
        0x0E,0xDF,0xEB,0x57,0x5D,0xFB,0xC6,0xE7,0xB7,0xCD,0xDC,0xCE,
        0x10,0x54,0x77,0x1A,0xEE,0x0F,0x49,0x7E,0x52,0x4E,0x56,0x58,
        0xCF,0x8D,0x76,0x59,0x0A,0xEC,0x44,0xD8,0xBB,0x72,0x82,0x90,
        0x83,0x3B,0x40,0xA4,0xF1,0xBD,0xD6,0x2A,0x29,0xE0,0xC5,0xF5,
        0xD0,0xED,0x30,0x18,0x4C,0x81,0x13,0x01,0x87,0x1E,0x7D,0x26,
        0x5A,0x63,0xD1,0xA6,0x95,0x2F,0x53,0xAE,0xCB,0xEA,0x2E,0x84,
        0x8E,0x62,0xCA,0x32,0x51,0x5B,0xF8,0x22,0xF6,0xFA,0x42,0xC4,
        0x7C,0x45,0x9C,0x16,0x9E,0x91,0xA7,0xB0,0x98,0x11,0xDD,0xB3,
        0x34,0x46,0x68,0xA3,0x3D,0x74,0x8B,0x14,0x92,0x15,0xD7,0xB2,
        0x48,0x7A,0xA9,0x9B,0x0C,0x17,0xE9,0x78,0x8B,0xFE,0x18,0xB6,
        0x29,0x40,0x45,0x0D,0x62,0xE6,0x41,0xBE,0xFB,0xAC,0x73,0x90,
        0x47,0x9B,0x4F,0x6F,0x61,0xD0,0x13,0x8F,0xC0,0xD1,0xDB,0x39,
        0xFA,0x27,0x77,0x74,0x22,0x02,0x86,0xD7,0x54,0x8D,0x3D,0x7A,
        0x3B,0x1B,0x5C,0xC2,0x32,0x11,0x48,0x33,0x5D,0xF5,0x60,0xB1,
        0x75,0xE2,0x53,0x99,0x87,0x58,0xAF,0x4A,0xA0,0x20,0x1D,0xFC,
        0x6E,0xD5,0x72,0xE5,0x3F,0x42,0x01,0x71,0xB3,0xB0,0x3E,0x5A,
        0xFD,0x9D,0x15,0x05,0x3C,0x5E,0x0F,0xB9,0xB4,0xA8,0xEB,0xF1,
        0x6B,0xDC,0x09,0x7F,0x63,0xD9,0xD3,0x4C,0xD4,0xBC,0x2D,0x00,
        0x44,0x1A,0xA1,0x4B,0x95,0xEF,0xB2,0x23,0x0A,0xD6,0xDA,0x83,
        0x9F,0x14,0xE0,0x1E,0xC7,0x94,0xA3,0xE4,0xC3,0x3A,0x4E,0x80,
        0x9A,0x36,0xC1,0x7B,0x65,0xFF,0xC4,0xF4,0x7D,0x19,0x43,0xBB,
        0xEA,0xAA,0x37,0xBA,0xE7,0xEC,0x57,0xE8,0x68,0x7C,0x67,0x0B,
        0xCF,0x50,0x8A,0x5F,0x6D,0x26,0xDF,0xCA,0x2F,0xAD,0xBD,0xCC,
        0x04,0x93,0x96,0xC8,0xF8,0xA7,0x2B,0x28,0x8E,0x85,0xCB,0x35,
        0xAE,0x16,0x9E,0xAB,0xB8,0x07,0xF2,0xB7,0xC5,0x2C,0xF9,0x59,
        0x51,0x79,0x55,0xF6,0xA4,0xD2,0xA6,0x52,0x34,0x12,0x1F,0x97,
        0xCE,0x31,0x2E,0xEE,0x91,0xF0,0x0E,0x82,0x70,0x03,0x4D,0x64,
        0xCD,0xBF,0xF3,0x10,0x08,0x38,0x6A,0x1C,0xE1,0xB5,0x6C,0xE3,
        0x88,0xDD,0x30,0xED,0x49,0x92,0x25,0x5B,0x69,0x06,0x2A,0x76,
        0x24,0x21,0x89,0x9C,0xF7,0xDE,0xD8,0xA5,0x56,0x98,0x8C,0x81,
        0xA9,0x46,0x7E,0xA2,0xC6,0x84,0xC9,0x66,0x20,0x93,0x36,0xA9,
        0x08,0x40,0x64,0x15,0x31,0xDC,0x49,0x4F,0xEC,0x9A,0xE8,0xD2,
        0x0E,0x84,0xCC,0xBC,0x27,0xF1,0x79,0xAA,0xED,0xE0,0x5F,0x7E,
        0x82,0xAD,0xD3,0x35,0x13,0x97,0xCA,0x44,0xDB,0xE2,0xE5,0x8B,
        0x16,0x67,0x60,0x0F,0x5D,0x01,0xB6,0x6F,0x91,0x34,0x02,0x95,
        0xDA,0x54,0xFF,0xCF,0x7D,0xB2,0xE9,0x5A,0x1C,0x76,0xC1,0x45,
        0x4B,0xD1,0x05,0xFD,0x1A,0xC2,0x52,0xC5,0x62,0xF8,0x72,0xD7,
        0x37,0xF3,0xDE,0x39,0x85,0xF5,0xC7,0x33,0x90,0xC6,0xF4,0x3B,
        0xB3,0x10,0x03,0xA1,0x9B,0xC8,0xD5,0x1E,0x3D,0xFC,0x87,0xEB,
        0x92,0x88,0x8F,0x21,0x71,0x7C,0xCB,0xCE,0x5E,0xEE,0x69,0x24,
        0xBD,0x18,0x8E,0xBA,0xDF,0x57,0xA6,0x4C,0xB5,0x51,0xB8,0xA0,
        0xB0,0x68,0x2E,0xAF,0x2C,0x78,0x55,0x14,0xB1,0x8A,0xBE,0x38,
        0x41,0x47,0x04,0x6A,0xC4,0x86,0xF7,0x6C,0x3C,0x6D,0xF6,0x30,
        0x99,0x77,0x3E,0x7A,0xFA,0xC3,0xEA,0xA3,0x4A,0x8C,0x1F,0xB4,
        0x3F,0x5C,0xE6,0x23,0x65,0xE3,0x9E,0x00,0x09,0x0D,0xA7,0xEF,
        0x59,0x11,0x43,0x26,0x2B,0xC0,0x07,0x1D,0x46,0x89,0xF0,0x66,
        0x75,0x0C,0xAC,0xBB,0x22,0xAB,0x63,0x8D,0x96,0xA5,0x61,0x29,
        0x7F,0x42,0x9F,0x5B,0xD8,0x53,0xE1,0x06,0xD4,0x2F,0x6B,0xA4,
        0xCD,0x98,0xFB,0x28,0xF9,0x73,0xBF,0xD0,0xD6,0x56,0x25,0x9C,
        0x80,0x19,0x58,0xB7,0x74,0x81,0x4D,0x9D,0x70,0xDD,0x2D,0xAE,
        0x32,0x7B,0xD9,0x1B,0x12,0xA8,0xC9,0x48,0xB9,0x83,0x4E,0x0B,
        0x94,0x3A,0x17,0x2A,0xA2,0xE4,0x0A,0x50,0xF2,0x6E,0xE7,0xFE,
        0xF0,0xC0,0xCB,0x9E,0x13,0xAB,0x87,0xE1,0xC1,0x7E,0x43,0x79,
        0x64,0xF6,0xBA,0xC3,0xE9,0x07,0x83,0x37,0xA6,0x27,0x0E,0x40,
        0xA7,0xAD,0xBC,0x7F,0xA0,0x7D,0x3B,0x39,0xED,0x1A,0x38,0xF1,
        0xBD,0x89,0x17,0x22,0x56,0xB9,0x25,0x2C,0x11,0x08,0xF5,0xA5,
        0x50,0x23,0xC7,0xAF,0xA9,0x2B,0x30,0xB0,0x5C,0x00,0xD2,0xB2,
        0xEE,0xC6,0xD0,0xE0,0x69,0xD8,0x8D,0x5F,0x96,0x8C,0xEC,0xF9,
        0xEB,0x81,0x6A,0x8A,0x86,0x67,0x0A,0x49,0x0D,0xD4,0x8F,0xDB,
        0xD3,0xFC,0x70,0xE5,0x8E,0x9B,0x6C,0xB7,0xF4,0xAA,0x12,0x80,
        0xB8,0xD6,0x60,0x95,0xFE,0x52,0x58,0x74,0xE6,0x61,0x28,0x3C,
        0x4E,0x4F,0xB1,0x55,0xCD,0x06,0xF2,0x31,0xDA,0x7B,0xEF,0x36,
        0xC9,0x48,0x97,0xDD,0x6B,0x84,0x4B,0x54,0x5E,0x9A,0xB6,0xD7,
        0xAE,0xF8,0xD5,0x63,0x1C,0xE7,0x16,0x46,0x9D,0xA4,0x29,0xAC,
        0xFD,0x05,0xBF,0xC8,0x62,0xF7,0x2D,0xA3,0x20,0xDF,0x18,0xE3,
        0x59,0xA1,0x10,0xFB,0x82,0x68,0x1E,0x78,0x91,0x5B,0x34,0x41,
        0x7A,0x04,0x1B,0x5D,0x6F,0x7C,0xB5,0xFA,0xFF,0xD9,0x15,0x1D,
        0xB3,0xBE,0xCE,0x21,0xC4,0xA8,0x2E,0x66,0x47,0x42,0x51,0x57,
        0x4C,0x44,0x93,0xA2,0x14,0xCF,0xEA,0x75,0x85,0x24,0xB4,0xCC,
        0xE2,0xD1,0x32,0x9F,0x19,0x77,0x65,0xC5,0x0F,0x02,0xCA,0xE8,
        0x1F,0x0B,0x71,0xC2,0x26,0xF3,0x09,0x33,0x45,0x3D,0x3E,0x3A,
        0x0C,0xE4,0x90,0x73,0x01,0x2A,0x53,0x9C,0xDC,0x03,0x6D,0x4D,
        0x72,0x98,0xBB,0x4A,0x92,0x2F,0x88,0x6E,0x5A,0x3F,0xDE,0x8B,
        0x94,0x99,0x35,0x76,0x9F,0x05,0x6A,0x88,0x1E,0xE6,0x84,0xB0,
        0x6D,0x5B,0x55,0x42,0xDE,0x70,0xE2,0x47,0xD3,0xF5,0xD1,0x22,
        0x6F,0xC5,0xF7,0x1A,0x0D,0x99,0xA8,0xD7,0xA7,0x79,0xC2,0xCB,
        0xF4,0xEF,0x94,0x7E,0x45,0x50,0x07,0x73,0x00,0x21,0x83,0xD0,
        0x19,0x5E,0xF3,0xF9,0xC8,0x61,0x52,0x08,0x91,0xDD,0x77,0xCF,
        0x6C,0x16,0x13,0xA3,0x9B,0xC6,0xAA,0x23,0x78,0x6B,0xE7,0x59,
        0x62,0x9C,0x56,0x04,0xF1,0xC3,0x2C,0x9D,0xBA,0xE0,0xDB,0xA4,
        0xA5,0x36,0x87,0x8F,0x71,0x74,0x1C,0x3B,0x68,0x5A,0x7D,0xE3,
        0xDA,0x8B,0x3F,0xD8,0x1B,0xE1,0xDC,0xA6,0x29,0x97,0x64,0x4B,
        0xC1,0x25,0xA1,0x96,0x58,0x81,0xD5,0x10,0xF2,0x93,0x40,0x31,
        0xAB,0x75,0xB4,0x1D,0xFC,0xC0,0x3C,0xEE,0x72,0xED,0xEC,0x0E,
        0xCA,0x4F,0x60,0xF0,0xBD,0x09,0x24,0xC4,0x65,0x02,0xBF,0x44,
        0x39,0x7C,0xEA,0xFA,0x8A,0x2E,0xBB,0x7B,0x43,0xFD,0x51,0xAE,
        0x3E,0xD2,0xA9,0xCD,0x92,0x33,0xA2,0xC7,0x17,0x48,0xB2,0xB3,
        0x12,0xA0,0x2F,0xB8,0x2A,0x41,0x9A,0x26,0x4E,0x5C,0x0C,0x14,
        0x85,0xDF,0x34,0x0B,0xD4,0xB1,0xC9,0x30,0x37,0x66,0x86,0xFB,
        0xCE,0x8D,0x6E,0x80,0x38,0x89,0x01,0x4A,0xAD,0x9E,0x53,0xFF,
        0x90,0xB5,0xD9,0x11,0x0F,0x7F,0x1F,0xBE,0xE4,0x18,0x54,0x5D,
        0xCC,0xB6,0x95,0x49,0x15,0xF8,0x3D,0xE9,0x67,0x7A,0x03,0x98,
        0x32,0x8C,0x0A,0x27,0x46,0x76,0xD6,0x8E,0xFE,0xE5,0x2B,0x20,
        0x06,0x2D,0x35,0xEB,0xF6,0xB7,0x63,0xE8,0x57,0x5F,0xB9,0x4C,
        0xBC,0x69,0x4D,0xAF,0x82,0x28,0x3A,0xAC,0xD3,0x82,0x23,0x75,
        0x88,0x3B,0x39,0x9C,0x8F,0xB5,0x2A,0x09,0x3F,0x3C,0x84,0xC3,
        0x96,0xB7,0xDD,0x21,0xF9,0xAB,0xE2,0xBF,0x6F,0x44,0xC2,0xE5,
        0x14,0x1A,0x4D,0xBE,0xB3,0x1F,0x56,0xA4,0x67,0xC8,0x7A,0xE9,
        0xA7,0x7D,0x9F,0xCE,0xA8,0x68,0x24,0xDE,0xE8,0xEA,0x41,0xF5,
        0x7F,0x5E,0x00,0xD2,0x0E,0x43,0x04,0xAD,0x10,0xD9,0xBA,0x26,
        0x5C,0x40,0x2B,0x55,0x47,0x74,0x1E,0x5B,0x2D,0x0A,0x35,0x31,
        0x79,0x8B,0x78,0x3E,0x71,0x48,0xFE,0x90,0xC6,0x17,0xB9,0xFC,
        0xD6,0x8D,0xE1,0x4F,0x2E,0x70,0xAC,0x0B,0x1B,0x92,0x51,0x83,
        0x4A,0x03,0xD5,0xF8,0x5F,0x08,0x8A,0x33,0xEE,0x12,0xEF,0xB2,
        0x7B,0xE4,0x25,0x5A,0x64,0xFB,0x9D,0x97,0xA6,0x7C,0xBB,0xA5,
        0xCB,0xD4,0xF0,0x16,0x49,0xF6,0x30,0x6B,0x22,0x46,0x3D,0x4E,
        0xE3,0x99,0x61,0x28,0x65,0x45,0x15,0x32,0x9B,0x19,0x42,0x94,
        0xAF,0xCD,0xF2,0x0C,0x57,0xB8,0x37,0xFF,0x4C,0xC1,0x1C,0xE7,
        0x3A,0x36,0x11,0xD0,0x89,0xCA,0x85,0x60,0xEC,0x29,0x50,0x27,
        0xAE,0xA3,0x62,0x06,0x9E,0xE0,0xA9,0xA1,0x2F,0x95,0x93,0x6A,
        0xBD,0x1D,0x59,0xB0,0x98,0x91,0x53,0x20,0x02,0xFA,0x34,0x76,
        0xDC,0x8E,0xC0,0x5D,0xC4,0xFD,0x52,0x80,0x38,0x58,0xAA,0xED,
        0xDA,0xF7,0x8C,0xC7,0xCC,0xE6,0x07,0xF4,0xD1,0x9A,0x0F,0x18,
        0xC9,0x2C,0x63,0x54,0xDF,0x87,0xB6,0xF3,0xB4,0xA0,0xB1,0x81,
        0x13,0x77,0x66,0x73,0x05,0xDB,0xEB,0xA2,0x6D,0x01,0x0D,0x4B,
        0xF1,0xC5,0xD8,0xD7,0x7E,0x86,0x72,0x6C,0x69,0xBC,0x6E,0xCF,
        0x5A,0x66,0x9A,0xA1,0xC5,0x3D,0x69,0x78,0x10,0xE6,0x7F,0x80,
        0x24,0x17,0x67,0x5C,0x39,0xD4,0x09,0xA9,0x9E,0x7B,0xD8,0xE8,
        0x00,0xE7,0x8B,0x99,0x23,0x68,0x90,0x74,0x8E,0x96,0x57,0x31,
        0x71,0x5E,0xCE,0x37,0x03,0x33,0x97,0x54,0xD6,0x85,0xA5,0xC9,
        0x26,0x3C,0xCA,0x36,0xB0,0x77,0xC3,0xA6,0x2B,0xFC,0x4F,0x48,
        0x6B,0x15,0xDB,0xE3,0x12,0xE9,0x58,0xD5,0xF3,0x4B,0x29,0x8F,
        0xA4,0xA0,0x93,0x2E,0x49,0xE1,0x89,0xD2,0xC1,0xF0,0xE2,0x98,
        0x19,0xDA,0xCB,0x65,0x0B,0xFE,0xDC,0x8D,0xD1,0x87,0x73,0xCF,
        0x94,0xF8,0x9D,0x9C,0x44,0xEC,0xEA,0xE4,0xFD,0xC4,0xB1,0x3F,
        0xBB,0x0C,0x46,0xCC,0x1C,0x72,0xAC,0xC8,0xC6,0x1F,0xD7,0x08,
        0x9F,0x7A,0x84,0xDE,0x13,0x95,0x2C,0xBF,0x1A,0x2D,0x07,0x7C,
        0xC0,0xAB,0x43,0x1D,0x45,0x18,0x0A,0xC7,0x64,0xAD,0x06,0x62,
        0xF4,0x59,0x22,0x51,0xB5,0xFF,0x50,0x28,0x6D,0x4A,0xD3,0xBC,
        0x76,0x3A,0x82,0x1E,0xEF,0x8A,0x47,0xFB,0x92,0x91,0xF2,0xA3,
        0xF6,0x42,0xEB,0x61,0xF5,0xA7,0xB2,0xF1,0xF9,0xDD,0xF7,0x35,
        0x3E,0x79,0xED,0x75,0x6E,0x8C,0x83,0xB8,0x02,0x01,0x30,0x4C,
        0xD9,0x70,0x88,0x0F,0xDF,0x4E,0x40,0x63,0x14,0xCD,0x56,0x53,
        0xB9,0xAE,0x25,0xB7,0x52,0x0D,0x41,0x81,0x7D,0x86,0xBA,0xD0,
        0x1B,0x2F,0xBE,0x7E,0x34,0x55,0x9B,0x5D,0x32,0x16,0x6A,0xE0,
        0xC2,0xB4,0xEE,0x5F,0x6C,0x60,0x3B,0x6F,0x11,0xB6,0xA2,0xFA,
        0x38,0x5B,0x20,0x05,0xAF,0x4D,0x2A,0xE5,0x27,0xAA,0x0E,0xA8,
        0x04,0xBD,0x21,0xB3,0xA4,0x49,0x29,0x30,0x0E,0x14,0x5C,0x22,
        0x39,0xC6,0x1B,0x6B,0x77,0xF3,0xBC,0x8C,0x7A,0x61,0x7F,0x3E,
        0x13,0x2E,0x92,0xE0,0x4D,0xF5,0xE1,0xD2,0x7B,0xE6,0x1A,0xB0,
        0xBF,0x06,0xA9,0x59,0xDA,0xB4,0xE3,0xB6,0x94,0x78,0xEA,0x6C,
        0x9C,0xD1,0xEE,0xA7,0xAA,0xB7,0x41,0xBA,0xA3,0x8D,0xF8,0x91,
        0xEF,0x70,0xBB,0xF7,0x4F,0xC3,0xDE,0xB8,0x52,0xF4,0x03,0xB5,
        0xE9,0xF1,0x0B,0xEC,0xA1,0x05,0x75,0x99,0xAF,0xCD,0x98,0x62,
        0x55,0x4C,0xA2,0x28,0x25,0xE5,0x40,0xA0,0x48,0x18,0x9D,0x87,
        0x10,0xAC,0xAE,0x00,0x5A,0x04,0xBE,0x56,0x3D,0x1F,0x50,0xF9,
        0x95,0x97,0xA6,0x8A,0x85,0x6E,0xC5,0xBD,0xAB,0x4E,0x34,0xD6,
        0xAD,0x36,0xE2,0x74,0xED,0x20,0xB3,0x69,0x16,0x46,0x96,0xFE,
        0x83,0x89,0x0C,0x24,0xEB,0xFF,0x42,0x3C,0x93,0xC1,0x6D,0xD3,
        0xF0,0xD4,0xC7,0x26,0xE4,0x9A,0x0A,0x1E,0xB2,0x2A,0x07,0x2B,
        0x58,0x4B,0x82,0x15,0x2F,0x37,0xE7,0x8B,0x7C,0x54,0xB1,0xFD,
        0xC4,0x1D,0x66,0x27,0xCE,0xDD,0xE8,0x51,0x7D,0x88,0xCA,0x53,
        0x3B,0x35,0x63,0xC0,0xC9,0x43,0xD8,0x02,0x5E,0x44,0x21,0x0D,
        0x9F,0xD0,0xF2,0xF6,0x45,0x12,0xB9,0x3A,0x3F,0x68,0x09,0xFC,
        0x9E,0x73,0x08,0x76,0x67,0x84,0x64,0xC2,0x5B,0x57,0x8E,0x4A,
        0xD5,0xDF,0x6A,0x65,0xA5,0x0F,0xFB,0x79,0x19,0x32,0x33,0x2D,
        0xA8,0x5D,0x71,0xFA,0xCC,0x7E,0x23,0x1C,0x31,0x8F,0x38,0xC8,
        0xDB,0x80,0x11,0xCF,0x5F,0x6F,0xD7,0xD9,0x60,0x9B,0x90,0x01,
        0x81,0x86,0xDC,0x2C,0x47,0x17,0xCB,0x72,0xF5,0xD9,0xAE,0x87,
        0x19,0x02,0x63,0xB0,0x39,0x9F,0x96,0xE2,0xF3,0xCD,0x37,0x6D,
        0x81,0xCB,0x2A,0xFD,0x8A,0x69,0x78,0x6F,0xFE,0x4A,0xCF,0x6E,
        0x4B,0x93,0x24,0x51,0xFF,0xAC,0x35,0xA0,0xEE,0x03,0xC7,0x77,
        0xA9,0x67,0xF4,0xC5,0xBD,0x2D,0x66,0xC1,0x74,0xE8,0x0F,0x10,
        0x00,0x29,0x72,0xA7,0xAD,0xF7,0x97,0x9E,0xBF,0x65,0x44,0x3C,
        0x36,0x9A,0x4D,0x3D,0xDB,0x60,0xE7,0xB6,0x2F,0x9C,0x5F,0x9B,
        0xE5,0x52,0xC3,0x1A,0x2C,0x59,0x1D,0xC8,0x38,0x31,0x16,0xD5,
        0x57,0x1C,0x7C,0xFB,0x85,0x83,0x7E,0xB3,0xE1,0x82,0xDC,0xB8,
        0x43,0xD6,0xBB,0xC6,0x41,0xDA,0xAF,0x30,0xEA,0x47,0x8D,0x7F,
        0xF1,0xC0,0xD4,0xEF,0x7B,0xA5,0x1B,0x28,0x6B,0x94,0x22,0x15,
        0x6C,0x4F,0xE3,0x54,0xDD,0x04,0xB5,0xEB,0x5A,0x23,0xDF,0x55,
        0x68,0xC9,0xE9,0x70,0x6A,0xBE,0x76,0x92,0xD8,0xF8,0x21,0xA3,
        0x08,0x18,0x49,0xC2,0xF6,0x79,0x75,0x0D,0x8C,0x8B,0x95,0x0E,
        0x25,0xAA,0x62,0x40,0x80,0x58,0x5B,0x5E,0xE4,0x4E,0x90,0x98,
        0xA6,0xFC,0x99,0x73,0x9D,0x2E,0x5D,0x71,0x3A,0xCC,0xB1,0x48,
        0xBC,0x26,0xB7,0x27,0x0B,0xF2,0x91,0x64,0xA4,0xBA,0x84,0x42,
        0x50,0x0A,0xE6,0xA2,0x17,0xCA,0xD1,0x2B,0x45,0xF9,0x1E,0x3B,
        0xE0,0xC4,0xD3,0x12,0xB2,0x86,0xD0,0x14,0x7D,0xD7,0x53,0x46,
        0x7A,0xA8,0x3E,0x56,0x5C,0x8F,0x13,0xCE,0xED,0x61,0xEC,0x06,
        0xB9,0xB4,0x34,0x4C,0x89,0x0C,0x88,0x01,0x33,0x05,0xAB,0x8E,
        0xA1,0x3F,0x07,0x32,0xD2,0x09,0xF0,0x1F,0xFA,0x20,0xDE,0x11,
        0xC2,0xE0,0x73,0x7E,0x46,0xCB,0xD6,0xC0,0x9D,0x61,0x92,0xC8,
        0x0A,0x3D,0xEE,0x81,0x55,0x54,0xC3,0x32,0x1C,0xDA,0x35,0x88,
        0x7C,0xA9,0xF7,0xE5,0x79,0x58,0x39,0xFC,0x99,0x89,0x8D,0xC7,
        0x51,0xC9,0x0B,0xE3,0x90,0x82,0x78,0xEA,0xD8,0x62,0xAC,0x77,
        0x22,0x2E,0x5F,0x2C,0x53,0xF9,0xA8,0x48,0x9C,0xED,0x68,0xF5,
        0xB3,0x3F,0xBD,0xEF,0x9F,0x1D,0x6E,0x47,0x24,0xA2,0x41,0x14,
        0xA0,0x93,0x6B,0xF6,0xCD,0xFB,0x8E,0x11,0xD4,0xE6,0xB8,0xEB,
        0x43,0x29,0xBE,0x80,0x85,0x5C,0x66,0x19,0x16,0x3A,0x95,0xA1,
        0xAE,0xC4,0x04,0x56,0x05,0x1A,0x87,0x07,0x75,0xA7,0x4A,0x3E,
        0x45,0xAA,0x96,0xB0,0x60,0xA6,0x26,0x6A,0x83,0xB4,0x84,0xCA,
        0x86,0xBF,0xFE,0x9E,0xFA,0xE9,0x4E,0x59,0x6D,0xC5,0x69,0x40,
        0x44,0xB2,0x76,0xF0,0x2F,0x38,0x12,0xD1,0x27,0x64,0x5E,0x18,
        0xD3,0xAD,0xA5,0x2D,0x0F,0x0C,0xA4,0x03,0x13,0x30,0xD5,0xDC,
        0xF3,0x1E,0xBB,0x6F,0xB5,0x23,0x0D,0x8C,0xDE,0xBA,0xCE,0x97,
        0x06,0x71,0xFF,0x91,0xD7,0x36,0xAF,0x37,0x63,0x7D,0xE4,0x1B,
        0x65,0xD9,0xF4,0x09,0x8B,0xCF,0x21,0x8A,0x5B,0xC6,0xE8,0xB1,
        0x50,0x5D,0x5A,0x49,0xA3,0x7A,0xEC,0x0E,0x7F,0xE2,0xAB,0x42,
        0x6C,0xDB,0xC1,0x70,0x4B,0x28,0xDF,0xF8,0x3C,0x4F,0xD2,0x7B,
        0x20,0x74,0x34,0x02,0x72,0x57,0xCC,0x94,0x8F,0xF1,0x67,0x01,
        0xB6,0x2A,0xFD,0x3B,0x9B,0xBC,0x52,0x4C,0x2B,0x31,0x10,0x25,
        0xDD,0xB7,0x9A,0xB9,0xF2,0x08,0x1F,0x4D,0x00,0xD0,0x33,0x98,
        0xE7,0x15,0x17,0xE1,0x6E,0xC5,0xDE,0x7E,0xF6,0x20,0xE1,0xAD,
        0x00,0xF7,0xCC,0x87,0x23,0xBD,0x57,0x94,0x49,0xCE,0x2B,0x4B,
        0x8C,0x01,0x0C,0x8D,0x3A,0x71,0x67,0xA6,0x14,0x21,0xEC,0x2E,
        0xAC,0xE9,0xE5,0xE3,0x55,0x28,0x98,0xBA,0xDF,0x68,0x58,0xDB,
        0x61,0x7C,0xFF,0x19,0x2F,0x3B,0x74,0x51,0x02,0x5A,0x6B,0x3C,
        0xD6,0x6D,0x13,0x6C,0x06,0x16,0x29,0xC0,0x30,0x10,0x3D,0xEA,
        0x9B,0x18,0x76,0xA3,0x93,0x83,0x07,0x48,0xFB,0x4F,0x11,0xA2,
        0xF2,0x81,0xAB,0xB8,0xF0,0x8A,0xC7,0xB7,0x1E,0x42,0xD9,0x60,
        0xD4,0xED,0x15,0x1F,0x4A,0xD1,0x1C,0x40,0x52,0x34,0x7B,0x46,
        0x5E,0xC6,0x77,0xB6,0x4E,0x1D,0x96,0xE4,0x31,0x05,0xC4,0xD7,
        0x3E,0x09,0x85,0xE8,0x41,0x69,0x9F,0x89,0xB4,0x5D,0x33,0xBC,
        0xD0,0x88,0x9E,0xB5,0xE7,0x08,0x50,0x04,0xFA,0x0D,0xC1,0x7D,
        0x6A,0x0B,0xB0,0x9C,0x35,0x36,0x8F,0x56,0xB1,0x37,0xEF,0xA7,
        0xCA,0x2C,0xEE,0xE2,0xBB,0xDD,0x0F,0x86,0xB2,0xF4,0xD8,0x63,
        0x72,0xCF,0x66,0x26,0x64,0x92,0xAF,0xC8,0x39,0x97,0x95,0xCB,
        0x45,0xA9,0x80,0xA0,0x79,0x3F,0xA1,0x0A,0xE0,0x78,0xBE,0x24,
        0xF9,0x1B,0xF3,0x4D,0xB9,0xF5,0x5C,0x62,0xFE,0xA5,0x12,0x65,
        0x91,0xAA,0xC3,0x27,0xAE,0x4C,0xFC,0x5F,0x82,0xF8,0x6F,0x53,
        0xB3,0xE6,0x5B,0x44,0xDA,0x70,0xD2,0xD3,0xEB,0x7A,0x25,0x0E,
        0x73,0xDC,0x2D,0x7F,0xD5,0xA4,0x84,0x59,0xA8,0x32,0x54,0x03,
        0xBF,0x8B,0x9D,0x9A,0xC2,0xCD,0x43,0xC9,0x8E,0x22,0x99,0x75,
        0x1A,0x47,0xF1,0x90,0x17,0x38,0x2A,0xFD,0xAF,0x99,0x14,0x68,
        0x17,0xA9,0x05,0x6E,0xEA,0x46,0xA1,0x2E,0xD2,0x4B,0xFE,0xAE,
        0x85,0xE1,0xED,0x76,0x58,0x3B,0xE0,0x44,0x6F,0x45,0x8F,0x57,
        0xD7,0xF8,0x24,0x07,0xA8,0x8A,0xB1,0xB8,0xE5,0x79,0x8E,0x98,
        0x4D,0x75,0xB6,0x2B,0x55,0xB0,0x7F,0x0C,0x52,0x51,0xBC,0xE7,
        0x97,0xE2,0x0E,0x41,0xE4,0xCE,0x26,0xD3,0xCC,0x7C,0xB4,0x13,
        0x16,0xBF,0x9D,0x1B,0x09,0x31,0x48,0x3F,0x18,0x30,0x8D,0x86,
        0xBA,0x12,0x9F,0xE6,0x38,0xDB,0x77,0xF5,0xAB,0x69,0x1E,0x9E,
        0x1A,0x9B,0xBD,0xA0,0x39,0xF9,0xCF,0x7B,0x70,0xA5,0xFB,0x83,
        0x9A,0x1D,0x5F,0xAC,0xC0,0xC8,0x06,0x43,0x5C,0x6A,0x90,0xFF,
        0xDC,0xC6,0xDF,0x8C,0x93,0x82,0xA7,0x91,0x3D,0xBE,0x36,0xF0,
        0xCA,0x00,0x0D,0x08,0x3A,0xC1,0xEE,0xD4,0xCB,0x3E,0x81,0xAD,
        0x5D,0xBB,0x66,0xD6,0x2D,0x2F,0x20,0x28,0xB2,0xAA,0xB9,0xCD,
        0x4E,0xDA,0x67,0x63,0x10,0x15,0x34,0x03,0x2A,0xF3,0x47,0x56,
        0x5E,0xC4,0x78,0x59,0xE8,0x1F,0x1C,0x49,0x4A,0x5A,0x80,0x89,
        0xF1,0xD9,0x6C,0x4C,0x3C,0xD1,0xF7,0xB7,0x2C,0x37,0x7D,0x4F,
        0x04,0x9C,0xE9,0xEF,0xD8,0xEB,0x62,0x0B,0x0F,0x84,0xB5,0xA3,
        0xC2,0xDE,0x02,0x11,0xF2,0x60,0x40,0x23,0x32,0xF6,0x21,0x73,
        0xEC,0x8B,0xA4,0xC5,0x35,0x96,0x87,0x50,0x54,0xD5,0x71,0x64,
        0x6B,0x88,0xD0,0x72,0x61,0xA6,0x53,0x19,0x29,0x42,0x6D,0x0A,
        0x7A,0x01,0x33,0x5B,0x25,0xFA,0x92,0xC3,0x94,0x74,0xE3,0xF4,
        0xC7,0xFC,0x27,0xFD,0x7E,0xB3,0xC9,0x95,0xDD,0xA2,0x22,0x65,
        0x0A,0xF3,0xFB,0x8F,0x1D,0xBA,0x48,0x71,0xB9,0x7F,0x5E,0x0D,
        0x2F,0xDC,0xC1,0xBC,0x4D,0xCF,0xA0,0xB5,0x31,0x74,0xEE,0x51,
        0xA5,0x55,0xCC,0x64,0x99,0x7B,0xEC,0xA3,0x9F,0x6D,0x03,0x9E,
        0x85,0x45,0xC0,0x0C,0x7D,0x49,0x30,0xD7,0xF7,0xF5,0x67,0x92,
        0xDB,0xA8,0x1E,0x34,0x28,0x78,0xDA,0x65,0x8C,0xE6,0xE0,0x56,
        0x3A,0x14,0x95,0x15,0x72,0xCB,0x8E,0xAC,0x68,0x05,0xAE,0x13,
        0x4B,0x57,0x38,0x94,0x6B,0xE8,0x60,0x04,0xF8,0x81,0x5C,0xF6,
        0xB7,0xF9,0xAA,0x39,0xD6,0xE2,0x96,0xC6,0x90,0xAF,0x6E,0xB3,
        0xE9,0x53,0xD4,0x10,0x3D,0x47,0xEA,0x3B,0xCD,0x2D,0x4A,0x24,
        0xD8,0x22,0x41,0x77,0xA2,0xBE,0x42,0x73,0x08,0xC4,0x1B,0xED,
        0xB0,0x5F,0xC5,0x44,0x4C,0x3F,0x6C,0xBD,0x61,0xDF,0xBB,0xDE,
        0x4F,0xAD,0xC7,0x7E,0xFD,0x59,0x2A,0x9C,0xF1,0x12,0x2B,0xB6,
        0xC8,0x98,0x32,0x18,0x17,0xDD,0x46,0xFA,0x9D,0x29,0x7C,0x88,
        0xB2,0xD0,0x5A,0xE1,0xF4,0xFF,0xB8,0x40,0xD2,0xC3,0x3E,0x2C,
        0x91,0x4E,0x54,0xF2,0x1C,0x82,0x5D,0xD5,0x9B,0x84,0x3C,0x9A,
        0xA1,0x19,0xA7,0x69,0x27,0xA4,0x07,0xCA,0x5B,0xD3,0x00,0x76,
        0x6A,0xEB,0xFE,0xBF,0x1F,0x93,0x87,0x83,0xEF,0xE4,0x52,0x7A,
        0xAB,0x1A,0x8A,0x86,0x80,0x79,0x21,0x35,0x36,0xA9,0x58,0x70,
        0x37,0x06,0x75,0x66,0xFC,0x02,0xCE,0x11,0x01,0x20,0xE3,0x62,
        0x63,0x0B,0x0F,0x0E,0x50,0x23,0xB1,0x16,0x33,0x09,0xB4,0xA6,
        0x2E,0xD1,0x6F,0x97,0xC2,0x26,0x25,0xE5,0x8D,0xC9,0x43,0x89,
        0xF0,0x8B,0xE7,0xD9,
    };

    public static void Scramble( byte [] p_key )
    {
        int i, x;

        for( i = 0, x = 0; i < 16; i++, x += 256 )
        {
            p_key[ i ] = scramble_vector[ p_key[ i ] + x ];
        }
    }
}
